using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("Players")]
	[Serializable]
    public class Player : DBO<Player>
    {
		#region Fields
		
		private int? _IdPlayer;
		private string _PlayerName;
		private int? _IdCountry;
		private DateTime? _Birthdate;
		private string _BirthPlace;
		private string _Height;
		private string _Weight;
		private string _Position;
		private int? _PlayerType;
		private string _Avatar;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public Player()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdPlayer 
		/// </summary>
		/// <param name="IdPlayer">The IdPlayer</param>
		public Player(int? IdPlayer )
		{
			this.IdPlayer = IdPlayer;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdPlayer">Sets int? value for IdPlayer</param>
		/// <param name="PlayerName">Sets string value for PlayerName</param>
		/// <param name="IdCountry">Sets int? value for IdCountry</param>
		/// <param name="Birthdate">Sets DateTime? value for Birthdate</param>
		/// <param name="BirthPlace">Sets string value for BirthPlace</param>
		/// <param name="Height">Sets string value for Height</param>
		/// <param name="Weight">Sets string value for Weight</param>
		/// <param name="Position">Sets string value for Position</param>
		/// <param name="PlayerType">Sets int? value for PlayerType</param>
		/// <param name="Avatar">Sets string value for Avatar</param>
		public Player(int? idPlayer, string playerName, int? idCountry, DateTime? birthdate, string birthPlace, string height, string weight, string position, int? playerType, string avatar)
		{
			this.IdPlayer = idPlayer;
			this.PlayerName = playerName;
			this.IdCountry = idCountry;
			this.Birthdate = birthdate;
			this.BirthPlace = birthPlace;
			this.Height = height;
			this.Weight = weight;
			this.Position = position;
			this.PlayerType = playerType;
			this.Avatar = avatar;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdPlayer
		/// </summary>
		[ColumnAttribute("IdPlayer", SqlDbType.Int , 4 , true, true, false)]
		public int? IdPlayer
		{
			set
			{
				this._IdPlayer = value;
			}
			get
			{
				return this._IdPlayer;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for PlayerName
		/// </summary>
		[ColumnAttribute("PlayerName", SqlDbType.NVarChar , 100 , false, false, true)]
		public string PlayerName
		{
			set
			{
				this._PlayerName = value;
			}
			get
			{
				return this._PlayerName;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdCountry
		/// </summary>
		[ColumnAttribute("IdCountry", SqlDbType.Int , 4 , false, false, true)]
		public int? IdCountry
		{
			set
			{
				this._IdCountry = value;
			}
			get
			{
				return this._IdCountry;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for Birthdate
		/// </summary>
		[ColumnAttribute("Birthdate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? Birthdate
		{
			set
			{
				this._Birthdate = value;
			}
			get
			{
				return this._Birthdate;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for BirthPlace
		/// </summary>
		[ColumnAttribute("BirthPlace", SqlDbType.NVarChar , 100 , false, false, true)]
		public string BirthPlace
		{
			set
			{
				this._BirthPlace = value;
			}
			get
			{
				return this._BirthPlace;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Height
		/// </summary>
		[ColumnAttribute("Height", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Height
		{
			set
			{
				this._Height = value;
			}
			get
			{
				return this._Height;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Weight
		/// </summary>
		[ColumnAttribute("Weight", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Weight
		{
			set
			{
				this._Weight = value;
			}
			get
			{
				return this._Weight;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Position
		/// </summary>
		[ColumnAttribute("Position", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Position
		{
			set
			{
				this._Position = value;
			}
			get
			{
				return this._Position;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for PlayerType
		/// </summary>
		[ColumnAttribute("PlayerType", SqlDbType.Int , 4 , false, false, true)]
		public int? PlayerType
		{
			set
			{
				this._PlayerType = value;
			}
			get
			{
				return this._PlayerType;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Avatar
		/// </summary>
		[ColumnAttribute("Avatar", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Avatar
		{
			set
			{
				this._Avatar = value;
			}
			get
			{
				return this._Avatar;
			}
		}
		
		
		/// <summary>
		/// Get a Country of current Player object base on IdCountry
		/// </summary>
		public Country Country
		{
			get
			{
				if (this.IdCountry == null)
					return null;
	
				Country condition = new Country(this.IdCountry);
				return CountryController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a list Card of current Player object base on IdPlayer
		/// </summary>
		public List<Card> CardListForIdPlayer
		{
			get
			{
				if (this.IdPlayer == null)
					return null;
				Card condition = new Card();
				condition.IdPlayer = this.IdPlayer;
				return CardController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list Goal of current Player object base on IdPlayer
		/// </summary>
		public List<Goal> GoalListForIdPlayer
		{
			get
			{
				if (this.IdPlayer == null)
					return null;
				Goal condition = new Goal();
				condition.IdPlayer = this.IdPlayer;
				return GoalController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list LineupDetail of current Player object base on IdPlayer
		/// </summary>
		public List<LineupDetail> LineupDetailListForIdPlayer
		{
			get
			{
				if (this.IdPlayer == null)
					return null;
				LineupDetail condition = new LineupDetail();
				condition.IdPlayer = this.IdPlayer;
				return LineupDetailController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list PlayerClubCurrent of current Player object base on IdPlayer
		/// </summary>
		public List<PlayerClubCurrent> PlayerClubCurrentListForIdPlayer
		{
			get
			{
				if (this.IdPlayer == null)
					return null;
				PlayerClubCurrent condition = new PlayerClubCurrent();
				condition.IdPlayer = this.IdPlayer;
				return PlayerClubCurrentController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list PlayerClubHistory of current Player object base on IdPlayer
		/// </summary>
		public List<PlayerClubHistory> PlayerClubHistoryListForIdPlayer
		{
			get
			{
				if (this.IdPlayer == null)
					return null;
				PlayerClubHistory condition = new PlayerClubHistory();
				condition.IdPlayer = this.IdPlayer;
				return PlayerClubHistoryController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list Transfer of current Player object base on IdPlayer
		/// </summary>
		public List<Transfer> TransferListForIdPlayer
		{
			get
			{
				if (this.IdPlayer == null)
					return null;
				Transfer condition = new Transfer();
				condition.IdPlayer = this.IdPlayer;
				return TransferController.FindItems(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdPlayer]
            /// </summary>
            public string IdPlayer
            {
                get
                {
                    return "IdPlayer";
                }
            }
            /// <summary>
            /// Get the name of column [PlayerName]
            /// </summary>
            public string PlayerName
            {
                get
                {
                    return "PlayerName";
                }
            }
            /// <summary>
            /// Get the name of column [IdCountry]
            /// </summary>
            public string IdCountry
            {
                get
                {
                    return "IdCountry";
                }
            }
            /// <summary>
            /// Get the name of column [Birthdate]
            /// </summary>
            public string Birthdate
            {
                get
                {
                    return "Birthdate";
                }
            }
            /// <summary>
            /// Get the name of column [BirthPlace]
            /// </summary>
            public string BirthPlace
            {
                get
                {
                    return "BirthPlace";
                }
            }
            /// <summary>
            /// Get the name of column [Height]
            /// </summary>
            public string Height
            {
                get
                {
                    return "Height";
                }
            }
            /// <summary>
            /// Get the name of column [Weight]
            /// </summary>
            public string Weight
            {
                get
                {
                    return "Weight";
                }
            }
            /// <summary>
            /// Get the name of column [Position]
            /// </summary>
            public string Position
            {
                get
                {
                    return "Position";
                }
            }
            /// <summary>
            /// Get the name of column [PlayerType]
            /// </summary>
            public string PlayerType
            {
                get
                {
                    return "PlayerType";
                }
            }
            /// <summary>
            /// Get the name of column [Avatar]
            /// </summary>
            public string Avatar
            {
                get
                {
                    return "Avatar";
                }
            }
        }
        #endregion
    }
}
